<template>
    <div class="tab-bar-item" @click="clickItem">
        <slot></slot>
    </div>
</template>



<script>

export default {
    name: 'TabBarItme',
    props:{path:String},
    methods:{
      clickItem(){
        // console.log(this.$router.history.current.path)
        // console.log(this.path)
        if( this.$router.history.current.path != this. path )
          this.$router.replace(this.path);
      }
    }
}
</script>

<style>
  .tab-bar-item {
    flex: 1;
    text-align: center;
    height: 49px;
    line-height: 49px;
    font-size:14px;
  }
</style>